package org.tis.tools.abf.module.ac.entity.vo;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import org.tis.tools.abf.module.ac.entity.AcAppConfig;
import org.tis.tools.abf.module.common.entity.enums.YON;
import org.tis.tools.model.enums.CommonEnumDeserializer;

import java.math.BigDecimal;

/**
 *  返回的应用个性化配置菜单
 * Created by chenchao
 * Created on 2018/10/12 10:55
 */
@Data
public class AcAppConfigDetail {

    private String guid;

    private String guidApp;

    private String configType;

    private String configName;

    private String configDict;

    private String configStyle;

    private String configValue;

    @JSONField(deserializeUsing = CommonEnumDeserializer.class)
    private YON enabled;

    private BigDecimal displayOrder;

    private String configDesc;

    /** 配置值字典名称 */
    private String dictName;

    /** 默认配置值名称 */
    private String valueName;

    public AcAppConfigDetail(){}

    public AcAppConfigDetail(AcAppConfig acAppConfig, String dictName, String valueName){
        this.guid = acAppConfig.getGuid();
        this.guidApp = acAppConfig.getGuidApp();
        this.configType = acAppConfig.getConfigType();
        this.configName = acAppConfig.getConfigName();
        this.configDict = acAppConfig.getConfigDict();
        this.configStyle = acAppConfig.getConfigStyle();
        this.configValue = acAppConfig.getConfigValue();
        this.enabled = acAppConfig.getEnabled();
        this.displayOrder = acAppConfig.getDisplayOrder();
        this.configDesc = acAppConfig.getConfigDesc();
        this.dictName = dictName;
        this.valueName = valueName;
    }
}
